<?php
namespace app\controller;

use think\App;
use think\facade\Db;
use think\Request;
use think\facade\View;
use think\exception\ValidateException;
use think\facade\Session;
use think\facade\Cookie;

/**
 *AAD注销登录
 */
class Logout
{

    /**
     * Request实例
     * @var \think\Request
     */
    protected $request;


    /**
     * 构造方法
     * @access public
     * @param  App  $app  应用对象
     */
    public function __construct(App $app)
    {
        $this->app     = $app;
        $this->request = $this->app->request;
    }


    //退出操作
    public function logout()
    {
        $auth = new \OneLogin\Saml2\Auth();

        $returnTo = config('app.url');

        $parameters = array();
        $nameId = null;
        $sessionIndex = null;
        $nameIdFormat = null;
        $samlNameIdNameQualifier = null;
        $samlNameIdSPNameQualifier = null;

        $auth->logout($returnTo, $parameters, $nameId, $sessionIndex, false, $nameIdFormat, $samlNameIdNameQualifier, $samlNameIdSPNameQualifier);
    }
}